package com.tancire.report.service.impl;

import java.util.List;
import javax.annotation.Resource;
import com.tancire.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.tancire.report.mapper.ReportAppFlowMapper;
import com.tancire.report.domain.ReportAppFlow;
import com.tancire.report.service.IReportAppFlowService;

/**
 * 应用接口流量Service业务层处理
 *
 * @author tancire
 * @date 2024-06-13
 */
@Service
public class ReportAppFlowServiceImpl implements IReportAppFlowService {
    @Resource
    private ReportAppFlowMapper reportAppFlowMapper;

    /**
     * 查询应用接口流量
     *
     * @param id 应用接口流量主键
     * @return 应用接口流量
     */
    @Override
    public ReportAppFlow selectReportAppFlowById(Long id) {
        return reportAppFlowMapper.selectReportAppFlowById(id);
    }

    /**
     * 查询应用接口流量列表
     *
     * @param reportAppFlow 应用接口流量
     * @return 应用接口流量
     */
    @Override
    public List<ReportAppFlow> selectReportAppFlowList(ReportAppFlow reportAppFlow) {
        return reportAppFlowMapper.selectReportAppFlowList(reportAppFlow);
    }

    /**
     * 新增应用接口流量
     *
     * @param reportAppFlow 应用接口流量
     * @return 结果
     */
    @Override
    public int insertReportAppFlow(ReportAppFlow reportAppFlow) {
        reportAppFlow.setCreateTime(DateUtils.getNowDate());
        return reportAppFlowMapper.insertReportAppFlow(reportAppFlow);
    }

    /**
     * 修改应用接口流量
     *
     * @param reportAppFlow 应用接口流量
     * @return 结果
     */
    @Override
    public int updateReportAppFlow(ReportAppFlow reportAppFlow) {
        reportAppFlow.setUpdateTime(DateUtils.getNowDate());
        return reportAppFlowMapper.updateReportAppFlow(reportAppFlow);
    }

    /**
     * 批量删除应用接口流量
     *
     * @param ids 需要删除的应用接口流量主键
     * @return 结果
     */
    @Override
    public int deleteReportAppFlowByIds(Long[] ids) {
        return reportAppFlowMapper.deleteReportAppFlowByIds(ids);
    }

    /**
     * 删除应用接口流量信息
     *
     * @param id 应用接口流量主键
     * @return 结果
     */
    @Override
    public int deleteReportAppFlowById(Long id) {
        return reportAppFlowMapper.deleteReportAppFlowById(id);
    }
}
